#include <iostream>
#include <deque>

using std::cout;
using std::endl;
using std::deque;

//多标签之间进行切换  :bn（下一个）/:bp(上一个)
//    :%s/原始字符串/目标字符串/g
//    :10, 11s/原始字符串/目标字符串/

void test()
{
    /* deque<int> number;//1、无参对象 */
    /* deque<int> number(10, 2);//2、count个value */
    //3、迭代器范围
    /* int arr[10] = {1, 3, 5, 7, 9, 8, 6, 4, 2, 10}; */
    /* deque<int> number(arr, arr + 10);//[,),左闭右开的区间 */
    //4、拷贝或者移动
    //5、大括号范围
    deque<int> number = {1, 3, 5, 7, 9, 2, 4, 6, 8, 10};

    //遍历
    //1、使用下标进行遍历
    for(size_t idx = 0; idx != number.size(); ++idx)
    {
        cout << number[idx] << "  ";
    }
    cout << endl;

    //y/d + 目标行号 + G
    //2、未初始化的迭代器
    deque<int>::iterator it;
    for(it = number.begin(); it != number.end(); ++it)
    {
        cout << *it << "  ";
    }
    cout << endl;

    //3、已经始化的迭代器
    /* deque<int>::iterator it2 = number.begin(); */
    auto it2 = number.begin();
    //ctrl + v  l/j/k/h方向键
    for(; it2 != number.end(); ++it2)
    {
        cout << *it2 << "  ";
    }
    cout << endl;

    //4、增强for循环(背后需要有迭代器做支撑)
    for(auto &elem : number)
    {
        cout << elem << "  ";
    }
    cout << endl;
}

class A
{
public:
    typedef int B;
};

int main(int argc, char *argv[])
{
    test();
    A::B a = 10;
    return 0;
}

